<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>爱涂说ß-分享</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Le styles -->
    <link href="../static/css/bootstrap.css" rel="stylesheet">
    <style>
      body {
        padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
      }
    </style>
    <!-- <link href="../static/css/bootstrap-responsive.css" rel="stylesheet"> -->

    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    <!-- Le fav and touch icons -->
  </head>

  <body>

    <div class="navbar navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </a>
          <a class="brand" href="#">爱涂说ß</a>
          <div class="nav-collapse">
            <ul class="nav">
              <li><a href="/">首页</a></li>
              <li><a href="#about">关于</a></li>
              <li><a href="#contact">联系</a></li>
            </ul>
            <ul class="nav pull-right">
              <li>
                <p>{{ user }}</p>
              </li>
              <li>
                <a href="/login/" onclick="$('#loginModal').modal();return false">登陆</a>
              </li>
              <li>
                <a href="/register/" onclick="$('#registerModal').modal();return false">注册</a>
              </li>
            </ul>
          </div><!--/.nav-collapse -->
        </div>
      </div>
    </div>

    <div class="container">
      <div class="hero-unit">
        <h2>完成</h2>
        <p>现在，你可以把你的画作分享给大家了：</p>
        <input type="text" size=60 id="share_link">
        <a name="xn_share" type="button_count_right" id="renren_share">分享</a>
        <a id="sian_share"><img src="../static/img/publish_button_24.gif"></a> 
        <img src="{{ cover }}" alt="" style="width:800px; height:500px;">
        
        <a class="btn btn-large btn-primary" onclick="$('#{{ type }}TitleModal').modal();return false">再画一幅</a>
        <a href="/" class="btn btn-large">回到主页</a>
      </div>


      <div class="modal hide fade" id="loginModal">
        <div class="modal-header">
          <h3>登陆</h3>
        </div>
        <div class="modal-body">
          <form action="/login/" id="login_form" method="post">
            <label>用户名</label>
            <input type="text" name="username" placeholer="你的用户名">
            <label>密码</label>
            <input type="password" name="password" placeholer="你的密码">
            <label class="checkbox">
              <input type="checkbox" name="remember_me">记住我
            </label>
            <!-- {{ xsrf_form_html() }} -->
          </form>
        </div>
        <div class="modal-footer">
          <a class="btn btn-primary" onclick="document.getElementById('login_form').submit(); return false">登陆</a>
          <a class="btn" onclick="$('#loginModal').modal('hide'); return false">取消</a>
        </div>
      </div>

      <div class="modal hide fade" id="registerModal">
        <div class="modal-header">
          <h3>注册</h3>
        </div>
        <div class="modal-body">
          <form action="/register/" id="register_form" method="post">
            <label>用户名</label>
            <input type="text" placeholder="中英文皆可" name="username">
            <label>密码</label>
            <input type="password" placeholder="大小写英文及数字，不少于8位" name="password">
            <label>重复密码</label>
            <input type="password" placeholder="请再输入一遍" name="password_again">
            <input type="hidden" name="nickname">
            <!-- {{ xsrf_form_html() }} -->
          </form>
        </div>
      </div>

      <div class="modal hide fade" id="{{ type }}TitleModal">
        <div class="modal-header">
          <h3>起个名字先</h3>
        </div>
        <div class="modal-body">
          <form action="/{{ type }}/" id="{{ type }}_title_form" method="get">
            <label>标题</label>
            <input type="text" placeholder="房间的名字" name="title">
            <label>昵称</label>
            <input type="text" placeholder="你的昵称" name="nickname" value="{{ user }}">
            <!-- {{ xsrf_form_html() }} -->
          </form>
        </div>
        <div class="modal-footer">
          <a class="btn btn-primary" onclick="document.getElementById('{{ type }}_title_form').submit(); return false">确认</a>
          <a class="btn" onclick="$('#{{ type }}TitleModal').modal('hide'); return false">取消</a>
        </div>
      </div>

      <hr>
      
      <footer>
        <p>&copy; quarkjoker 2012</p>
      </footer>
    </div> <!-- /container -->

    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="../static/js/jquery.js"></script>
    <script src="../static/js/bootstrap.js"></script>
    <script type="text/javascript">
      document.getElementById('share_link').value = "http://"+window.location.host+'/{{ type }}/{{ sessionid }}';
      document.getElementById('renren_share').href = "http://"+window.location.host+'/{{ type }}/{{ sessionid }}';
      document.getElementById('sian_share').href = "javascript:void((function(s,d,e,r,l,p,t,z,c){var%20f='http://v.t.sina.com.cn/share/share.php?appkey=真实的appkey',u=z||d.location,p=['&url=',e(u),'&title=',e(t||d.title),'&source=',e(r),'&sourceUrl=',e(l),'&content=',c||'gb2312','&pic=',e(p||'')].join('');function%20a(){if(!window.open([f,p].join(''),'mb',['toolbar=0,status=0,resizable=1,width=440,height=430,left=',(s.width-440)/2,',top=',(s.height-430)/2].join('')))u.href=[f,p].join('');};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();})(screen,document,encodeURIComponent,'','','','{{ title }}','"+ "http://"+window.location.host+'/{{ type }}/{{ sessionid }}' +"','utf-8'));"
    </script>
    <script src="http://static.connect.renren.com/js/share.js" type="text/javascript"></script>
  </body>
</html>
